package com.ssy.lingxi.order.controller.web;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.dataauth.annotation.order.VendorAuth;
import com.ssy.lingxi.order.model.vo.basic.request.*;
import com.ssy.lingxi.order.model.vo.basic.response.*;
import com.ssy.lingxi.order.model.vo.buyer.response.BuyerOrderPayNodeDetailVO;
import com.ssy.lingxi.order.model.vo.vendor.request.*;
import com.ssy.lingxi.order.model.vo.vendor.response.*;
import com.ssy.lingxi.order.service.web.IVendorOrderService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu 订单能力 - 销售订单相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
@RestController
@RequestMapping("/order/vendor")
public class VendorOrderController {
    @Resource
    private IVendorOrderService vendorOrderService;

    /**
     * “待分配订单” - 获取前端页面下拉框列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/take/page/items", method = RequestMethod.GET)
    public Wrapper<List<DropdownItem>> getTakePageItems(@RequestHeader HttpHeaders headers) {
        return vendorOrderService.getTakePageItems(headers);
    }

    /**
     * “待分配订单” - 查询订单列表
     * @param headers  Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/take/page", method = RequestMethod.GET)
    public Wrapper<PageData<BaseVendorOrderQueryVO>> pageToTakeOrders(@RequestHeader HttpHeaders headers, @Valid OrderPageVO pageVO) {
        return vendorOrderService.pageToTakeOrders(headers, pageVO);
    }

    /**
     * “待分配订单” - 订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/take/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToTakeOrderDetail(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToTakeOrderDetail(headers, idVO);
    }

    /**
     * “待分配订单” - 领取订单
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/take", method = RequestMethod.POST)
    public Wrapper<Void> takeOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderIdVO idVO) {
        return vendorOrderService.takeOrder(headers, idVO);
    }

    /**
     * “待分配订单” - 批量领取订单
     * @param headers Http头部信息
     * @param orderIds 订单Id列表
     * @return 操作结果
     */
    @RequestMapping(value = "/take/batch", method = RequestMethod.POST)
    public Wrapper<Void> batchTakeOrders(@RequestHeader HttpHeaders headers, @RequestBody @Valid List<OrderIdVO> orderIds) {
        return vendorOrderService.batchTakeOrders(headers, orderIds);
    }

    /**
     * "待核销自提订单" - 分页查询订单列表
     * @param headers Http头部信息
     * @param pageVO  接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/verify/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorVerifyOrderQueryVO>> pageVerifyOrders(@RequestHeader HttpHeaders headers, @Valid VendorVerifyOrderPageVO pageVO) {
        return vendorOrderService.pageVerifyOrders(headers, pageVO);
    }

    /**
     * "待核销自提订单" - 核销自提订单
     * @param headers Http头部信息
     * @param orderVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/verify", method = RequestMethod.POST)
    public Wrapper<Void> validateVerifyOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorVerifyOrderVO orderVO) {
        return vendorOrderService.validateVerifyOrder(headers, orderVO);
    }

    /**
     * （订单查询页面）获取前端页面下拉框列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/page/items", method = RequestMethod.GET)
    public Wrapper<PageItemVO> getPageItems(@RequestHeader HttpHeaders headers) {
        return vendorOrderService.getPageItems(headers);
    }

    /**
     * 分页查询订单
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorOrderQueryVO>> pageOrders(@RequestHeader HttpHeaders headers, @Valid OrderManagePageVO pageVO) {
        return vendorOrderService.pageOrders(headers, pageVO);
    }

    /**
     * 订单查询导出
     * @param token 登录token
     * @param pageVO 接口参数
     * @param response 响应体
     */
    @RequestMapping(value = "/export", method = RequestMethod.GET)
    public void exportOrders(HttpServletResponse response, @Valid OrderManagePageVO pageVO, String token) {
        vendorOrderService.exportOrders(response, pageVO, token);
    }

    /**
     * 订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getOrderDetail(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getOrderDetail(headers, idVO);
    }

    /**
     * 查询订单优惠券记录
     * @param headers Http头部信息
     * @param orderIdVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/coupon", method = RequestMethod.GET)
    public Wrapper<List<VendorOrderCouponVO>> findOrderCoupons(@RequestHeader HttpHeaders headers, OrderIdVO orderIdVO) {
        return vendorOrderService.findOrderCoupons(headers, orderIdVO);
    }

    /**
     * 查询订单商品的营销活动记录
     * @param headers Http头部信息
     * @param productIdVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/promotion", method = RequestMethod.GET)
    public Wrapper<PageData<VendorOrderProductPromotionVO>> findOrderProductPromotions(@RequestHeader HttpHeaders headers, OrderProductIdVO productIdVO) {
        return vendorOrderService.findOrderProductPromotions(headers, productIdVO);
    }

    /**
     * 中止订单
     * @param headers Http头部信息
     * @param reasonVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/terminate", method = RequestMethod.POST)
    public Wrapper<Void> terminateOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderReasonVO reasonVO) {
        return vendorOrderService.terminateOrder(headers, reasonVO);
    }

    /**
     * 取消订单
     * @param headers Http头部信息
     * @param reasonVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/cancel", method = RequestMethod.POST)
    public Wrapper<Void> cancelOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderReasonVO reasonVO) {
        return vendorOrderService.cancelOrder(headers, reasonVO);
    }

    /**
     * “转单” - 预览转单订单列表
     * @param headers Http头部信息
     * @param transferOrderVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/transfer/preview", method = RequestMethod.POST)
    public Wrapper<List<VendorTransferOrderQueryVO>> preTransferOrders(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorTransferOrderVO transferOrderVO) {
        return vendorOrderService.preTransferOrders(headers, transferOrderVO);
    }

    /**
     * “转单” - 确认转单
     * @param headers Http头部信息
     * @param transferOrderVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/transfer", method = RequestMethod.POST)
    public Wrapper<Void> transferOrders(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorTransferOrderVO transferOrderVO) {
        return vendorOrderService.transferOrders(headers, transferOrderVO);
    }

    /**
     * 生成支付链接
     * @param headers Http头部信息
     * @param idVO    接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/generate/pay/link", method = RequestMethod.GET)
    public Wrapper<GeneratePayLinkVO> generatePayLink(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.generatePayLink(headers, idVO);
    }

    /**
     * （订单审核各个页面）获取前端页面下拉框列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/page/items", method = RequestMethod.GET)
    public Wrapper<ValidatePageItemVO> getValidatePageItems(@RequestHeader HttpHeaders headers) {
        return vendorOrderService.getValidatePageItems(headers);
    }

    /**
     * “待提交审核订单” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/submit/page", method = RequestMethod.GET)
    public Wrapper<PageData<OrderPageQueryVO>> pageSubmitToConfirmOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageSubmitToConfirmOrders(headers, pageVO);
    }

    /**
     * “待提交审核订单” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/submit/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getSubmitToConfirmOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getSubmitToConfirmOrderDetails(headers, idVO);
    }

    /**
     * “分页查询订单列表、待提交审核订单” - 修改运费和商品价格
     * @param headers Http头部信息
     * @param freightVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/submit/freight/update", method = RequestMethod.POST)
    public Wrapper<Void> updateFreightAndProductPrices(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorUpdateFreightVO freightVO) {
        return vendorOrderService.updateFreightAndProductPrices(headers, freightVO);
    }

    /**
     * “待提交审核订单” - 修改支付比例
     * @param headers Http头部信息
     * @param payRateVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/submit/payment/update", method = RequestMethod.POST)
    public Wrapper<Void> updatePayRate(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorUpdatePayRateVO payRateVO) {
        return vendorOrderService.updatePayRate(headers, payRateVO);
    }

    /**
     * “待提交审核订单” - 提交审核
     * @param headers Http头部信息
     * @param agreeVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/submit", method = RequestMethod.POST)
    public Wrapper<Void> submitToConfirmOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderAgreeVO agreeVO) {
        return vendorOrderService.submitToConfirmOrder(headers, agreeVO);
    }

    /**
     * “待审核订单（一级）” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/grade/one/page", method = RequestMethod.GET)
    public Wrapper<PageData<OrderPageQueryVO>> pageToValidateGradeOneOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToValidateGradeOneOrders(headers, pageVO);
    }

    /**
     * “待审核订单（一级）” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/grade/one/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToValidateGradeOneOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToValidateGradeOneOrderDetails(headers, idVO);
    }

    /**
     * “待审核订单（一级）” - 提交审核
     * @param headers Http头部信息
     * @param agreeVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/grade/one", method = RequestMethod.POST)
    public Wrapper<Void> validateOrderGradeOne(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderAgreeVO agreeVO) {
        return vendorOrderService.validateOrderGradeOne(headers, agreeVO);
    }

    /**
     * “待审核订单（一级）” - 批量审核
     * @param headers Http头部信息
     * @param orderIds 接口参数
     * @return 审核结果
     */
    @RequestMapping(value = "/validate/grade/one/batch", method = RequestMethod.POST)
    public Wrapper<Void> batchValidateOrdersGradeOne(@RequestHeader HttpHeaders headers, @RequestBody @Valid List<OrderIdVO> orderIds) {
        return vendorOrderService.batchValidateOrdersGradeOne(headers, orderIds);
    }

    /**
     * “待审核订单（二级）” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/grade/two/page", method = RequestMethod.GET)
    public Wrapper<PageData<OrderPageQueryVO>> pageToValidateGradeTwoOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToValidateGradeTwoOrders(headers, pageVO);
    }

    /**
     * “待审核订单（二级）” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/grade/two/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToValidateGradeTwoOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToValidateGradeTwoOrderDetails(headers, idVO);
    }

    /**
     * “待审核订单（二级）” - 提交审核
     * @param headers Http头部信息
     * @param agreeVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/grade/two", method = RequestMethod.POST)
    public Wrapper<Void> validateOrderGradeTwo(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderAgreeVO agreeVO) {
        return vendorOrderService.validateOrderGradeTwo(headers, agreeVO);
    }

    /**
     * “待审核订单（一级）” - 批量提交审核
     * @param headers Http头部信息
     * @param orderIds 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/grade/two/batch", method = RequestMethod.POST)
    public Wrapper<Void> batchValidateOrdersGradeTwo(@RequestHeader HttpHeaders headers, @RequestBody @Valid List<OrderIdVO> orderIds) {
        return vendorOrderService.batchValidateOrdersGradeTwo(headers, orderIds);
    }

    /**
     * “待确认订单” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/confirm/page", method = RequestMethod.GET)
    public Wrapper<PageData<OrderPageQueryVO>> pageToConfirmOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToConfirmOrders(headers, pageVO);
    }

    /**
     * “待确认订单” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/confirm/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToConfirmOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToConfirmOrderDetails(headers, idVO);
    }

    /**
     * “待确认订单” - 确认
     * @param headers Http头部信息
     * @param agreeVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/confirm", method = RequestMethod.POST)
    public Wrapper<Void> confirmOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderAgreeVO agreeVO) {
        return vendorOrderService.confirmOrder(headers, agreeVO);
    }

    /**
     * “待确认支付结果” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/pay/confirm/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorConfirmPayQueryVO>> pageToConfirmPayOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToConfirmPayOrders(headers, pageVO);
    }

    /**
     * “待确认支付结果” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/pay/confirm/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToConfirmPayOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToConfirmPayOrderDetails(headers, idVO);
    }

    /**
     * “待确认支付结果” - 确认支付结果
     * @param headers Http头部信息
     * @param confirmPayVO 接口参数
     * @return 确认结果
     */
    @RequestMapping(value = "/validate/pay/confirm", method = RequestMethod.POST)
    public Wrapper<Void> confirmOrderPayment(@RequestHeader HttpHeaders headers, @RequestBody @Valid ConfirmPayVO confirmPayVO) {
        return vendorOrderService.confirmOrderPayment(headers, confirmPayVO);
    }

    /**
     * “待新增销售发货单” -查询订单列表
     * @param headers Http头部信息
     * @param pageVO  接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/sell/delivery/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorSellDeliveryPageVO>> pageSellDeliveryOrders(@RequestHeader HttpHeaders headers, @Valid OrderSellDeliveryPageVO pageVO) {
        return vendorOrderService.pageSellDeliveryOrders(headers, pageVO);
    }

    /**
     * “待新增销售发货单” - 创建发货单
     * @param headers Http头部信息
     * @param orderVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/create/sell/delivery", method = RequestMethod.POST)
    public Wrapper<Void> createSellDelivery(@RequestHeader HttpHeaders headers, @RequestBody @Valid SellDeliveryOrderVO orderVO) {
        return vendorOrderService.createSellDelivery(headers, orderVO);
    }

    /**
     * “待新增销售发货单” - 查看详情
     * @param headers Http头部信息
     * @param idVO    接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/sell/delivery/detail", method = RequestMethod.GET)
    public Wrapper<VendorSellDeliveryDetailVO> getSellDeliveryDetail(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getSellDeliveryDetail(headers, idVO);
    }

    /**
     * “审核销售发货单” - 审核销售发货单
     * @param headers Http头部信息
     * @param idVO    接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/sell/delivery", method = RequestMethod.POST)
    public Wrapper<Void> validateToSellDeliveryOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid OrderIdVO idVO) {
        return vendorOrderService.validateToSellDeliveryOrder(headers, idVO);
    }

    /**
     * “待新增物流单” - 查询订单列表
     * @param headers Http头部信息
     * @param pageVO  接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/create/logistics/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorLogisticsPageVO>> pageCreateLogistics(@RequestHeader HttpHeaders headers, @Valid CreateLogisticsPageVO pageVO) {
        return vendorOrderService.pageCreateLogistics(headers, pageVO);
    }

    /**
     * “待新增物流单” - 查看详情
     * @param headers Http头部信息
     * @param idVO    接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/create/logistics/detail", method = RequestMethod.GET)
    public Wrapper<VendorLogisticsDetailVO> getLogisticsDetail(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getLogisticsDetail(headers, idVO);
    }

    /**
     * “新增物流单” - 选择商品 - 发货单商品明细
     * @param headers Http头部信息
     * @param pageVO  接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/logistics/product/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorLogisticsProductQueryVO>> pageLogisticsProducts(@RequestHeader HttpHeaders headers, @Valid VendorLogisticsProductPageVO pageVO) {
        return vendorOrderService.pageLogisticsProducts(headers, pageVO);
    }

    /**
     * “待确认发货订单” -查询订单列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/delivery/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorDeliveryQueryVO>> pageToDeliveryOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToDeliveryOrders(headers, pageVO);
    }

    /**
     * “待确认发货订单” - 查询订单详情
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/delivery/detail", method = RequestMethod.GET)
    public Wrapper<VendorOrderDetailVO> getToDeliveryOrderDetails(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.getToDeliveryOrderDetails(headers, idVO);
    }

    /**
     * “待确认发货订单” - “确认发货” - 查询商品列表
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/delivery/product", method = RequestMethod.GET)
    public Wrapper<List<VendorDeliveryProductVO>> getToDeliveryProducts(@RequestHeader HttpHeaders headers, @Valid VendorDeliveryNoAndOrderIdVO idVO) {
        return vendorOrderService.getToDeliveryProducts(headers, idVO);
    }

    /**
     * “待确认发货订单” - 发货
     * @param headers Http头部信息
     * @param deliveryVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/validate/delivery/confirm", method = RequestMethod.POST)
    public Wrapper<Void> deliveryOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorDeliveryVO deliveryVO) {
        return vendorOrderService.deliveryOrder(headers, deliveryVO);
    }

    /**
     * 代客下单 - 创建订单
     * @param headers HttpHeader信息
     * @param orderVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/create/agent/order", method = RequestMethod.POST)
    public Wrapper<Void> createAgentOrder(@RequestHeader HttpHeaders headers, @RequestBody @Valid AgentOrderVO orderVO) {
        return vendorOrderService.createAgentOrder(headers, orderVO);
    }

    /**
     * 代客下单 - 查询支付方式与支付渠道列表
     * @param headers   Http头部信息
     * @param payTypeVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/create/agent/pay/types", method = RequestMethod.GET)
    public Wrapper<List<OrderPayTypeDetailVO>> findAgentOrderPayTypes(@RequestHeader HttpHeaders headers, @Valid AgentOrderPayTypeVO payTypeVO) {
        return vendorOrderService.findAgentOrderPayTypes(headers, payTypeVO);
    }

    /**
     * 代客下单 - 根据企业商城类型获取下单模式和类型
     * @param headers Http头部信息
     * @param shopTypeVO 订单来源商城的类型
     * @return 查询结果
     */
    @RequestMapping(value = "/get/order/mode", method = RequestMethod.GET)
    public Wrapper<OrderModeVO> findAgentOrderModeTypes(@RequestHeader HttpHeaders headers, @Valid OrderShopTypeVO shopTypeVO){
        return vendorOrderService.findAgentOrderModeTypes(headers, shopTypeVO);
    }

    /**
     * 代客下单 - 查询支付环节列表
     * @param headers Http头部信息
     * @param payVO   接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/create/agent/payment/find", method = RequestMethod.POST)
    public Wrapper<List<BuyerOrderPayNodeDetailVO>> findAgentOrderProcessPayment(@RequestHeader HttpHeaders headers, @RequestBody @Valid AgentOrderProcessPayVO payVO) {
        return vendorOrderService.findAgentOrderProcessPayment(headers, payVO);
    }

    /**
     * 订单查询 - 获取小程序二维码
     * @param headers Http头部信息
     * @param idVO    接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/mini/app/code", method = RequestMethod.GET)
    public Wrapper<String> createMiniAppCode(@RequestHeader HttpHeaders headers, @Valid OrderIdVO idVO) {
        return vendorOrderService.createMiniAppCode(headers, idVO);
    }

    /**
     * 订单分页查询 - 通用 - 所有订单类型下拉框列表
     * @return 查询结果
     */
    @RequestMapping(value = "/order/type/all", method = RequestMethod.GET)
    public Wrapper<List<DropdownItem>> getAllOrderType() {
        return vendorOrderService.getAllOrderType();
    }

    /**
     * “待确认回单订单” - 查询订单分页列表
     * @param headers Http头部信息
     * @param pageVO  接口参数
     * @return 查询结果
     */
    @VendorAuth
    @RequestMapping(value = "/validate/receipt/confirm/page", method = RequestMethod.GET)
    public Wrapper<PageData<VendorReceiptOrderPageVO>> pageToConfirmReceiptOrders(@RequestHeader HttpHeaders headers, @Valid OrderValidatePageVO pageVO) {
        return vendorOrderService.pageToConfirmReceiptOrders(headers, pageVO);
    }

    /**
     * “待确认回单订单” - 确认回单
     * @param headers Http头部信息
     * @param orderVO  接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/validate/receipt/confirm", method = RequestMethod.POST)
    public Wrapper<Void> confirmOrderReceipt(@RequestHeader HttpHeaders headers, @RequestBody @Valid VendorBatchNoAndOrderIdVO orderVO) {
        return vendorOrderService.confirmOrderReceipt(headers, orderVO);
    }
}
